DEFAULT_AUTO_FIELD='django.db.models.BigAutoField'
 #配置邮件发送后端
 #EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend'

 # 配置你的 SMTP 邮箱服务，此处如果大家是 QQ 邮箱就写 smtp.qq.com
EMAIL_HOST = 'smtp.qq.com'

 # 配置你的邮箱账号，注意字符串中应为你真实的邮箱账号，此处为虚假邮箱
EMAIL_HOST_USER = '3485873238@qq.com'

# 配置你申请的授权码替换此处字符串
EMAIL_HOST_PASSWORD = 'xvfxsusxwganchbc'

 # 邮箱端口号，具体端口号需要根据你使用的邮箱服务确定，此处 QQ 邮箱是 587
EMAIL_PORT = 587

 # 配置邮箱是否使用加密传输，此处不使用，如要使用，还需要配置加密证书相关步骤
EMAIL_USE_TLS = False
"""
Django settings for mysite project.

Generated by 'django-admin startproject' using Django 5.1.2.

For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'blog.apps.BlogConfig',
    # 注册标签模块到系统
    'taggit',
    'django.contrib.postgres' 
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'mysite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases

DATABASES = {
    'default':{
        #数据库引擎更换为postgresql
        'ENGINE': 'django.db.backends.postgresql',
        #数据库名更换为你在安装好的PostgreSQL数据库中创建的名称
        'NAME': 'blog',
        #数据库用户名更换为你在安装好的PostgreSQL数据库中创建的用户名称
        'USER': 'blog',
        #数据库密码更换为你在安装好的PostgreSQL数据库中的密码
        'PASSWORD': '123456'
    }
}


# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/5.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

